using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableTreasureRefineLevelDao:DaoBase<TableTreasureRefineLevel>
    {
        public override void AddPrimaryIndex(TableTreasureRefineLevel model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableTreasureRefineLevel.txt";
        }

        protected override TableTreasureRefineLevel ParseRowData(string[] rowData)
        {
            TableTreasureRefineLevel data = new TableTreasureRefineLevel();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.id = 0;
            }
            else
            {
                data.id = int.Parse(rowData[0]);
            }
			data.treasureId = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.level = 0;
            }
            else
            {
                data.level = int.Parse(rowData[2]);
            }
			data.objStr = rowData [3];
			data.skillId = rowData [4];

            return data;
        }


        public override void AddOneIndex(TableTreasureRefineLevel model)
        {
            if (!cacheOneIndex.ContainsKey(model.treasureId.ToString()))
            {
                cacheOneIndex[model.treasureId.ToString()] = new List<TableTreasureRefineLevel>();
            }
            cacheOneIndex[model.treasureId.ToString()].Add(model);
        }
    

    }

}
